# # # # # # # # # # # # # # # # # # # # # # # #
# ObZen, a security through obscurity script  #
# Feel free to use this script to your liking #
#  											  #
# By Denzo  								  #
# # # # # # # # # # # # # # # # # # # # # # # #


# Import libs needed for encoding/decoding functions
import codecs
import zlib


# Encoding function
def encode(input):

	# Base64,  ascii
	output = codecs.encode(input, 'base64')
	output = codecs.encode(output, 'ascii')

	# Compress with zlib
	output = zlib.compress(output)

	# Base64, ascii, rot13
	output = codecs.encode(output, 'base64')
	output = codecs.encode(output, 'ascii')
	output = codecs.encode(output, 'rot13')
	
	# Cut away the first two characters which are always the the same
	output = output[2:len(output)]
	
	# Return encoded string
	return output
	
	
# Decoding function	
def decode(input):

	# Add in first two characters again
	output = "rW" + input

	# Decode rot13, ascii, base64
	output = codecs.decode(output, 'rot13')
	output = codecs.decode(output, 'ascii')		
	output = codecs.decode(output, 'base64')

	# Decompress zlib
	output = zlib.decompress(output)

	# Decode ascii, base64
	output = codecs.decode(output, 'ascii')
	output = codecs.decode(output, 'base64')
	
	# Return decoded string
	return output